<template>
  <div class="control-item">
    <div class="control-header">
      <span class="control-name">会员信息</span>
    </div>
    <div class="control-body">
      <div class="control-section">
        <!-- 图片设置 -->
        <uploadImg
          :uploadImg="params.params.memberAdImg"
          size="750*264px"
          @uploadSuccess="uploadSuccess"
          @deleteImg="deleteImg"
        ></uploadImg>
      </div>
    </div>
  </div>
</template>

<script>
import uploadImg from "@/components/DiyNew/uploadImg/index.vue";

export default {
  name: "userMemberAdImgControl",
  components: {
    uploadImg,
  },
  props: {
    params: {
      type: Object,
      default: {},
    },
  },
  data() {
    return {};
  },
  watch: {},
  computed: {},
  mounted() {
    console.log("传进来的啥啊", this.params);
  },
  methods: {
    uploadSuccess(e) {
      this.$setWithAction(this.params, "memberAdImg", e.val);
    },
    // 删除图片回调
    deleteImg(e) {
      this.$setWithAction(this.params, "memberAdImg", "");
    },
  },
};
</script>

<style lang="scss" scoped>
.control-item {
  width: 100%;
  height: 100%;
  margin: 0 auto;
  .control-header {
    width: 100%;
    height: 48px;
    background: #ffffff;
    border-bottom: 1px solid #f0f2f5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 24px 14px 24px;
    span {
      font-size: 12px;
      color: #8c8c8c;
    }
    .control-name {
      font-size: 14px;
      font-weight: 600;
      color: #000000;
    }
    span:nth-child(2) {
      cursor: pointer;
    }
  }
  .control-body {
    width: 100%;
    .control-section {
      width: 228px;
      margin: 0 auto;
      text-align: center;
      .control-item {
        width: 100%;
        .control-title {
          padding: 24px 0 14px 0;
          font-size: 12px;
          color: #000000;
          text-align: left;
        }
      }
    }
  }
}
</style>
